package com.ericsson.smart;

import java.util.ArrayList;
import java.util.Map;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class UtilityStartUpListener<T> {
	private Map<String, Object> reportMetaData;
	

	private Map<String, ArrayList<T>> hierarchyMetaData;

	// private HashMap<String, ArrayList<String>> hierarchyMetaData;
	
	@SuppressWarnings("unchecked")
	@Autowired
	public UtilityStartUpListener(UtilityMetaDataLoader metaDataLoader,UtilityCommon utilCommon) {
		
		System.out.println("UtilityStartUpListener................."+metaDataLoader);
		System.out.println("START-UP-LISTENER: Going to create MetaDataLoader"  );
		//UtilityMetaDataLoader metaDataLoader = new UtilityMetaDataLoader();
		reportMetaData = metaDataLoader.loadingReportMetaData();
		hierarchyMetaData = metaDataLoader.loadMetaData();

		utilCommon.setReportMetaData(reportMetaData);
		utilCommon.setHierarchyMetaData(hierarchyMetaData);

		System.out.println("REPORT-COUNT:" + reportMetaData.size() + ":" + reportMetaData.keySet());
		System.out.println("HIERARCHY-COUNT:" + hierarchyMetaData.size() + ":"
				+ hierarchyMetaData.keySet());
	}
}
